import React, { Component } from 'react'
import './App.css'
import Card from "../src/components/Card"
import axios from 'axios'

export default class App extends Component {

  constructor(props) {
    super(props);
    this.state = {
      goods:[]
    }
  }

  render() {
    return (
      <div>
        <h3>商品列表</h3>
        <Card goods={this.state.goods}></Card>
      </div>
    )
  }

  componentDidMount() {
    axios.get("http://api.kudesoft.cn/tdk/goods")
    .then(res => {
      this.setState({
        goods:res.data.data.data.list
      })
    })
  }
}

